<%@ page import="News.service.UserServer" %>
<%@ page import="javax.swing.*" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/12/20 0020
  Time: 8:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册控制</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    String username=(String)request.getParameter("username");
    String password=(String)request.getParameter("password");
    String refpassword=(String)request.getParameter("refpassword");

    UserServer us=new UserServer();
    int j=us.Register(username,password);

//    if(!refpassword.equals(password)){
//        request.getSession().setAttribute("name","两次密码不一样！");
//        response.sendRedirect("/App/Register.jsp");
//    }else{
//        UserServer us=new UserServer();
//        int i=us.selectUserName(username);
//        if(i>0){
//            request.getSession().setAttribute("name","用户已注册！");
//            response.sendRedirect("/App/Register.jsp");
//            return;
//        }
//
//        if(i==0){
//            int j=us.Register(username,password);
//            if(j>0){
//                request.getSession().setAttribute("name","已成功注册！");
//                response.sendRedirect("/App/Login.jsp");
//                return;
//            }else{
//                request.getSession().setAttribute("name","注册失败！");
//                response.sendRedirect("/App/Register.jsp");
//                return;
//            }
//        }
//    }

%>
</body>
</html>
